package flex.command
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import flex.business.UserDelegate;
	import flex.event.UserEvent;
	import flex.model.UserModelLocator;
	import flex.vo.UserVO;
	
	import mx.rpc.IResponder;
	
	public class UserCommand implements ICommand, IResponder
	{
//		private var userModelLocator:UserModelLocator = new UserModelLocator();
		public function UserCommand()
		{
		}
		
		public function execute(event:CairngormEvent):void
		{
			var userDelegate:UserDelegate = new UserDelegate(this);
			var userEvent:UserEvent = UserEvent(event);
			userDelegate.login( UserEvent(event).userVO);
//			this.result(UserEvent(event).userVO);
		}
		
		public function result(data:Object):void
		{
//			userModelLocator.userVo = UserVO(data);
			var rollBack:UserVO = data as UserVO;
			UserModelLocator.getInstance().userVo = rollBack;
		}
		
		public function fault(info:Object):void
		{
		}
	}
}